package com.mooer;

import android.app.Application;
import android.graphics.Bitmap;

import com.mooer.app.provider.DBHelper;
import com.mooer.bean.User;
import com.mooer.utils.UtilTools;
import com.mooer.utils.ui.ImageUtils;

/**
 * 类说明
 * 
 * @author pengfei.xu
 * @version V1.0 创建时间：2011-4-28 下午05:31:29
 */
public class MooerApplication extends Application {

	private User user;

	private double latitude;

	private double longitude;

	private String address = "";

	private boolean isLoggedin;

	private Bitmap shopListDefaultIcon;

	private Bitmap avatarIcon;

	private DBHelper dbHelper;

	@Override
	public void onCreate() {
		super.onCreate();
		shopListDefaultIcon = ImageUtils.drawableToBitmap(getResources()
				.getDrawable(R.drawable.m_seller_pic));
		avatarIcon = ImageUtils.drawableToBitmap(getResources().getDrawable(
				R.drawable.avatar_pic_x));
		dbHelper = new DBHelper(this);
	}

	public Bitmap getShopListDefaultIcon() {
		return shopListDefaultIcon;
	}

	public void setShopListDefaultIcon(Bitmap shopListDefaultIcon) {
		this.shopListDefaultIcon = shopListDefaultIcon;
	}

	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = UtilTools.round(latitude, 5);
	}

	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = UtilTools.round(longitude, 5);
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public boolean isLoggedin() {
		return isLoggedin;
	}

	public void setLoggedin(boolean isLoggedin) {
		this.isLoggedin = isLoggedin;
	}

	/**
	 * @return the user
	 */
	public User getUser() {
		return user;
	}

	/**
	 * @param user
	 *            the user to set
	 */
	public void setUser(User user) {
		this.user = user;
	}

	public DBHelper getDbHelper() {
		return dbHelper;
	}

	public void setDbHelper(DBHelper dbHelper) {
		this.dbHelper = dbHelper;
	}

	public Bitmap getAvatarIcon() {
		return avatarIcon;
	}

	public void setAvatarIcon(Bitmap avatarIcon) {
		this.avatarIcon = avatarIcon;
	}

}